#!/bin/bash

# sudo apt-get install -y gcc g++ git cmake ninja-build
# git clone https://github.com/llvm/llvm-project.git

# BUILD_TYPE=Release
BUILD_TYPE=Debug
PREFIX_DIR=/home/zzy/llvm-16.0.6/bin

cd llvm-project
git checkout -b llvmorg-16.0.6 llvmorg-16.0.6
mkdir build
cd build

cmake -G Ninja -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="clang" \
	-DCMAKE_INSTALL_PREFIX=${PREFIX_DIR} ../llvm
ninja -j16
# ninja check-all
# ninja install
